package com.winter.Controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.winter.model.IonlineAppointment;
import com.winter.service.IonlineAppointmentService;
import com.winter.util.Result;

import jodd.madvoc.meta.In;

@RestController
@RequestMapping("/ionlineApp")
public class IonlineAppointmentController {
    @Resource
    private IonlineAppointmentService ionlineAppointmentService;

    /*
     * 新增预约资产信息
     *
     */
    @PostMapping("/insertIonline")
    public Result insertIonline(@RequestBody IonlineAppointment ion) {
        return ionlineAppointmentService.insertIonline(ion);
    }

    /*
     * 我的预约资产信息
     *
     */
    @GetMapping("/getIonlineList")
    public Result getIonlineList(Integer pageNumber, Integer pageSize, String userNo) {
        return ionlineAppointmentService.getIonlineList(pageNumber, pageSize, userNo);
    }


    /*
     * 取消预约资产信息
     *
     */
    @GetMapping("/deleteIonlineList")
    public Result deleteIonlineList(Long id) {
        return ionlineAppointmentService.deleteIonlineList(id);
    }
    
    @PutMapping("/update")
    public Result update(@RequestBody IonlineAppointment ion){
    	return ionlineAppointmentService.update(ion);
    }
    
    @GetMapping("/getByIonlineKey")
    public Result getByIonlineKey(String id, String userNo,String type) {
        return ionlineAppointmentService.getByIonlineKey(id,userNo,type);
    }
}
